package com.miaosha.ms_05.dao;

import com.miaosha.ms_05.domain.MiaoshaOrder;
import org.apache.ibatis.annotations.*;

@Mapper
public interface MiaoshaOrderDao {

    @Insert("INSERT INTO miaosha_order (USER_ID,ORDER_ID,GOODS_ID) VALUES (#{mo.userId},#{mo.orderId},#{mo.goodsId})")
    @SelectKey(keyColumn="id", keyProperty="id", resultType=long.class, before=false, statement="select last_insert_id()")
    Long insert(@Param("mo") MiaoshaOrder mo);

    @Delete("DELETE FROM miaosha_order")
    void deleteMiaoshaOrder();
}
